'use strict';
const nunjucks = require('nunjucks');

let env = nunjucks.configure('views', { autoescape: true, watch: true, noCache: true });

function temp() {
    return async (ctx, next) => {
        ctx.render = function (view, data) {
            ctx.body = env.render(view, data);
        }
        await next();
    }
}

module.exports=temp;